//const Host  = 'http://tds-hainan/diancan/api/';
const Host  = 'http://hainan.qdss.com.cn/diancan/api/';
const Token = localStorage.token;
const ImagesPath = 'http://hainan.qdss.com.cn';

function checkLogin()
{
	if(!Token) {
		window.location.href = 'login.html';	
	}
}


var getUrlParameter = function getUrlParameter(sParam) {
    var sPageURL = window.location.search.substring(1),
        sURLVariables = sPageURL.split('&'),
        sParameterName,
        i;

    for (i = 0; i < sURLVariables.length; i++) {
        sParameterName = sURLVariables[i].split('=');

        if (sParameterName[0] === sParam) {
            return sParameterName[1] === undefined ? true : decodeURIComponent(sParameterName[1]);
        }
    }
};

function getTypeId()
{
  var type_id = 2;
  var hour = new Date().getHours() ;
  if(hour<9) {
    type_id = 1;
  }else if(hour>17) {
    type_id = 3
  }

  return type_id;

}